<div class="content-section introduction " >
  <div>
    <span class="feature-title">设备管理 | <small>设备配置</small> </span>
  </div>
</div>
<div class="content-section implementation GridDemo report">
  <div class="ui-g">
    <div class="ui-g-4 treeTag">
      <h4 style="margin-bottom: 15px;">设备类型</h4>
      <p-tree [value]="assetTypes" selectionMode="single" [(selection)]="selected" (onNodeExpand)="nodeExpand($event)"(onNodeSelect) = "NodeSelect($event)" [contextMenu]="cm" [style.height.px]="700"></p-tree>
      <p-contextMenu #cm [model]="items"></p-contextMenu>
    </div>
    <div class="ui-g-8">
      <h4>{{ titleName }}</h4>
      <div class="ui-grid-row text_aligin_right">
        <button pButton type="button" class="btn_add" (click)="showPerEdit()" label="新增" icon="fa-plus" [disabled]="canAdd"></button>
        <button pButton type="button" class="btn_add" (click)="showPerDelete()" label="删除" icon="fa-close"></button>

        <div class="ui-widget-header" style="padding:4px 10px;border-bottom: 0 none">
          <i class="fa fa-search" style="margin:4px 4px 0 0"></i>
          <input #gb type="text" pInputText size="50" placeholder="查询">
        </div>

        <p-dataTable [value]="tableDatas"
                     [responsive]="true"  id="manageTable" [(selection)]="selectedPers" [globalFilter]="gb">
          <!--<p-footer>-->
          <!--<p-paginator rows="10" totalRecords="120" [rowsPerPageOptions]="[10,20,30]" pageLinkSize="10"></p-paginator>-->
          <!--</p-footer>-->
          <p-column selectionMode="multiple" ></p-column>
          <p-column field="asset_no" header="oid" [sortable]="true"></p-column>
          <p-column field="asset_name" header="名称" [sortable]="true"></p-column>
          <p-column field="u_height" header="U高度" [sortable]="true"></p-column>
          <p-column field="weight" header="重量" [sortable]="true"></p-column>
          <p-column field="power" header="功率" [sortable]="true"></p-column>
          <p-column field="color" header="操作项" [style]="{'width':'12vw'}">
            <ng-template let-datas="rowData" pTemplate="operator">
              <button pButton type="button"  (click)="showPerEdit(datas)" label="修改"  class="ui-button-info"></button>
              <!--<button pButton type="button"  (click)="showPerDelete(datas)" label="删除"  class="ui-button-info"></button>
              <button pButton type="button"  (click)="showCogRoleMask(datas,true)" label="关联角色"  class="ui-button-info"></button>
              <button pButton type="button"  (click)="showCogRoleMask(datas,false)" label="查看角色"   class="ui-button-info"></button>
              <button pButton type="button"  (click)="modifyPassword(datas)" label="修改密码"   class="ui-button-info"></button>-->
            </ng-template>
          </p-column>
          <ng-template pTemplate="emptymessage">
            当前没有数据
          </ng-template>
        </p-dataTable>
      </div>
    </div>
  </div>
</div>


<p-growl [(value)]="msgs"></p-growl>

<!-- 删除组织弹框 -->
<p-growl [(value)]="deletemsgs"></p-growl>
<p-dialog header="删除确认框" [(visible)]="showOrgDeleteMask" modal="modal" width="300" [responsive]="true">
  <p>{{deleteOrgTip}}</p>
  <p-footer>
    <button type="button" pButton icon="fa-check" (click)="deleteOrg()" label="确定"></button>
    <button type="button" pButton icon="fa-close" (click)="showOrgDeleteMask=false" label="取消"></button>
  </p-footer>
</p-dialog>

<!-- 删除人员弹框 -->
<p-growl [(value)]="deletemsgs"></p-growl>
<p-dialog header="删除确认框" [(visible)]="showPerDeleteMask" modal="modal" width="300" [responsive]="true">
  <p>{{deletePerTip}}</p>
  <p-footer>
    <button type="button" pButton icon="fa-check" (click)="deletePer()" label="确定"></button>
    <button type="button" pButton icon="fa-close" (click)="showPerDeleteMask=false" label="取消"></button>
  </p-footer>
</p-dialog>

<!-- 新增和修改设备类型弹框 -->
<app-equipment-type-edit [currentOrg]="selectedNode" [state]="state" (closeOrgEdit)="closeOrgEdit($event)" (addOrg)="addOrgNode($event)" (updateOrg)="updateOrgNode($event)" *ngIf="showOrgEditMask"></app-equipment-type-edit>

<!-- 新增和编辑设备型号弹框 -->
<app-equipment-edit [currentPer]="selectedCol" [state]="personState" (closePersonEdit)="closePersonEdit($event)" (addPer)="addPersonNode($event)" (updatePer)="updatePersonNode($event)" *ngIf="showPersonEditMask"></app-equipment-edit>


